package util;

public class Validator {
	public static boolean isNumeric(Object o, boolean space){
		String regex;
		if(space)
			regex = "[\\d|\\s]{";
		else
			regex = "[\\d]{";
		return o.toString().matches(regex+o.toString().length()+"}");
	}
	public static String heavyTrim(Object o){
		if(o == null)
			return "";
		return o.toString().replace("  ", " ").trim();
	}
	public static boolean isEmpty(Object o){
		o = Validator.heavyTrim(o);
		if(o == null || o.toString().isEmpty())
			return true;
		return false;
			
	}
}
